clear
log using "E:\FIS_duration\max_onloan_sttl_rep.log"
infix episode 2-5 str ticker 7-12 type 14-14 ndays 16-19 numol 21-24 olbeg 26-34 olmax 36-44 olend 46-54 retob 56-64 retoa 66-74 numav 76-79 avbeg 81-89 avmax 91-99 avend 101-109 retavb 111-119 retava 121-129 numu 130-133 ubeg 135-143 umax 145-153 uend 155-163 retub 165-173 retua 175-183 using "e:\FIS\episode_rets_chg_trddate_rep.txt"
summarize retob if retob >= -1
summarize retoa if retoa >= -1
summarize retob if retob >= -1 & type == 1
summarize retob if retob >= -1 & type == 2
summarize retob if retob >= -1 & type == 3
summarize retoa if retoa >= -1 & type == 1
summarize retoa if retoa >= -1 & type == 2
summarize retoa if retoa >= -1 & type == 3
summarize retavb if retavb >= -1
summarize retava if retava >= -1
summarize retavb if retavb >= -1 & type == 1
summarize retavb if retavb >= -1 & type == 2
summarize retavb if retavb >= -1 & type == 3
summarize retava if retava >= -1 & type == 1
summarize retava if retava >= -1 & type == 2
summarize retava if retava >= -1 & type == 3
summarize retub if retub >= -1
summarize retua if retua >= -1
summarize retub if retub >= -1 & type == 1
summarize retub if retub >= -1 & type == 2
summarize retub if retub >= -1 & type == 3
summarize retua if retua >= -1 & type == 1
summarize retua if retua >= -1 & type == 2
summarize retua if retua >= -1 & type == 3
log close
